package java_dome.base;

public class Dog {
    static int age;  // 类变量，默认值为0;
    public static final int name1 = 123;
    public String name2;  // 实例变量

    public Dog(String name) {
        // 构造器
        name2 = name;
    }

     public void eat() {
        String food = "苹果";  // 局部变量
        System.out.println("吃");
    }

    public void setName() {
        System.out.print(name1);
    }

    public static void main(String[] args) {
        Dog dog = new Dog("狗");
        System.out.println(dog.name2);
        Boolean a = Boolean.FALSE;
        int b = (a == Boolean.TRUE) ? 10 : 2;
        boolean c = dog instanceof Dog;
        do {
            b += 1;
            System.out.println(b);
        } while (b <= 10);
        for (int x = 1; x < 10; x += 1) {
            System.out.println(x);
        }
        System.out.println();
        switch ("1") {
            case "1":
                System.out.println("sdfsd");
                break;
        }
    }
}